<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Page_Controller{
    var $data = array();
    var $view = '';
    var $use_global_template = TRUE;
    function Page_Controller(){
        $CI = & get_instance();
	   	$this->use_global_template();
        //$this->module_navigation(get_class($this));
        //$this->module_toolbar();
    }
    
    function view($view){
        $this->view = $view;
    }
    
    function add($key, $val){
        if(is_string($key))
            $key = array($key=>$val);
        foreach($key as $k=>$v)
            $this->data[$k] = $v;
    }
    
    function sort_column($title, $sort_field, $sort_type, $base_url, $cur_sort_field=''){
        return sort_column($title, $sort_field, $sort_type, $base_url, $cur_sort_field);
    }
    
    function get_view(){
        return $this->view;
    }
    
    function get_data(){
        return $this->data;
    }
    
    function use_global_template($flag = TRUE){
        $CI = & get_instance();
        $CI->use_global_template = $flag;
    }
    
    function module_navigation($str){
        $this->add('module_nav', $str);
    }
    
    function module_toolbar($module=NULL, $data = array()){
        if(is_null($module)){
            $this->add('module_toolbar', '');
            return;
        }
        $CI = & get_instance();
        $this->add('module_toolbar', $CI->parser->module_parse($module, $data, TRUE));
    }
    
    function module_tabbar($module=NULL, $data = array()){
        if(is_null($module)){
            $this->add('module_tabbar', '');
            return;
        }
        $CI = & get_instance();
        $this->add('module_tabbar', $CI->parser->module_parse($module, $data, TRUE));
    }
}
?>